Public Declare Function RasEnumConnections Lib "RasApi32.dll" Alias "RasEnumConnectionsA" (lpRasCon As Any, lpcb As Long, lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib "RasApi32.dll" Alias "RasGetConnectStatusA" (ByVal hRasCon As Long, lpStatus As Any) As Long
'
Public Const RAS95_MaxEntryName = 256
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32
'
Public Type RASCONN95
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
'
Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Public Function Render() As String
PrepareCrap 'get the crap ready For this new situation.
MakeTable
ClearAllRegions
Render = localTable.html 'return the resulting html
End Function
Public Function AddRegion(html As String, Left As Double, Top As Double, Width As Double, Height As Double, bgcolor As String)
objectCounter = objectCounter + 1
ReDim Preserve regionGroup(objectCounter)
If html = "" Then html = " "
regionGroup(objectCounter - 1).html = html
regionGroup(objectCounter - 1).Left = Left
regionGroup(objectCounter - 1).Top = Top
regionGroup(objectCounter - 1).Width = Width
regionGroup(objectCounter - 1).Height = Height
If bgcolor <> "" Then
regionGroup(objectCounter - 1).bgcolor = bgcolor
End If
End Function
Private Function ClearAllRegions()
objectCounter = 0
Erase regionGroup()
End Function
Private Sub PrepareCrap()
Erase tableArray()
localTable.cellsWide = calculateCellsWide
localTable.cellsTall = calculateCellsTall
localTable.html = "" 'set html to nothing so that old rendering doesn't show up here
localTable.Width = 0
localTable.Height = 0
ReDim tableArray(localTable.cellsWide, localTable.cellsTall, 4) 'resize the tablearray table
For i = 0 To localTable.cellsWide
For j = 0 To localTable.cellsTall
tableArray(i, j, objectLevel) = -1
Next j
Next i
End Sub
Private Sub SortX()
Dim edgeCoordinate As Integer
For i = 0 To localTable.cellsWide - 1
edgeCoordinate = 9999
For j = 0 To (objectCounter - 1)
If (i = 0) Then
If (regionGroup(j).Left < edgeCoordinate) Then
edgeCoordinate = regionGroup(j).Left
End If
ElseIf ((regionGroup(j).Left < edgeCoordinate) And (regionGroup(j).Left > tableArray((i - 1), 0, xLevel))) Then
edgeCoordinate = regionGroup(j).Left
End If
Next j
If (edgeCoordinate <> 9999) Then
If i = localTable.cellsWide Then Beep
tableArray(i, 0, xLevel) = edgeCoordinate
End If
Next i
End Sub
Private Sub SortY()
Dim edgeCoordinate As Integer
For i = 0 To localTable.cellsTall - 1
edgeCoordinate = 9999
For j = 0 To (objectCounter - 1)
If (i = 0) Then
If (regionGroup(j).Top < edgeCoordinate) Then
edgeCoordinate = regionGroup(j).Top
End If
ElseIf ((regionGroup(j).Top < edgeCoordinate) And (regionGroup(j).Top > tableArray(0, (i - 1), yLevel))) Then